# encoding: utf-8
"""
Input arguments (Parameters) for zones resources RESTful API
-----------------------------------------------------------
"""

from flask_marshmallow import base_fields
from flask_restplus_patched import Parameters
from flask_restplus_patched import PostFormParameters, PatchJSONParameters

from . import schemas
from .models import Zone


class ZonesParameters(Parameters):
    available = base_fields.Boolean(
        description = "",
        missing = None,  # default value
    )


class ZonesInstallParamters(Parameters):
    zones = base_fields.String(
        description = "数据中心编码，多个以英文逗号分隔",
        required = False,
        missing = None,
    )

    data_from = base_fields.String(
        description = "数据来源：none or demo or product",
        required = True,
        missing = "demo",
    )

    only_db = base_fields.Boolean(
        description = "是否只安装数据库（true：安装数据库和应用，false：只安装数据库）",
        required = True,
        missing = "false",
    )


class CreateZonesParameters(PostFormParameters, schemas.BaseZonesSchema):
    class Meta(schemas.BaseZonesSchema.Meta):
        # This is not supported yet: https://github.com/marshmallow-code/marshmallow/issues/344
        required = (
        )
